package cn.com.blueInfo.bpm.person.convert;

import cn.com.blueInfo.bpm.common.convert.BaseConvert;
import cn.com.blueInfo.bpm.person.entity.Headship;
import cn.com.blueInfo.bpm.person.request.HeadshipDTO;
import cn.com.blueInfo.bpm.person.response.HeadshipVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

/**
 * 职务信息表 对象转换
 * @author suxch
 * @since 2025-08-31 16:18:02
 */
@Mapper(componentModel = "spring")
public interface HeadshipConvert
        extends BaseConvert<Headship, HeadshipDTO, HeadshipVO> {

    Headship dtoToEntity(HeadshipDTO dto);

    Headship dtoToEntity(HeadshipDTO.UpdatePartialDTO dto);

    @Mapping(source = "status", target = "status", qualifiedByName = "enumToDesc")
    @Mapping(source = "deleted", target = "deleted", qualifiedByName = "enumToDesc")
    @Mapping(source = "leaderFlag", target = "leaderFlag", qualifiedByName = "enumToDesc")
    HeadshipVO entityToVO(Headship entity);

}